<div id="page">
	<div id="header">
		<table id="headerTable" align="center" style="border-spacing:0 !important;">
			<tbody>
				<tr>
					<td id="resourceWrapper">
						<table class="porob" id="resourceTable">
							<tbody>
								<tr>
									<td class="res_current poloses_t"><img class="tooltip" data-tooltip-content="<span class='p_res'>{$LNG.tech.901}</span><br/>{$LNG.tip_p_res_h} {$js_metal_hr|number}<br/>{$LNG.tip_p_res_d} {($js_metal_hr*24)|number}<br/>{$LNG.tip_p_res_m} {($js_metal_hr*720)|number}" src="{$dpath}images/metall.gif" alt="" title="" /><span id="current_metal">{$metal|number}</span></td>
									<td class="res_current poloses_t"><img class="tooltip" data-tooltip-content="<span class='p_res'>{$LNG.tech.902}</span><br/>{$LNG.tip_p_res_h} {$js_crystal_hr|number}<br/>{$LNG.tip_p_res_d} {($js_crystal_hr*24)|number}<br/>{$LNG.tip_p_res_m} {($js_crystal_hr*720)|number}" src="{$dpath}images/kristall.gif" alt="" title="" /><span id="current_crystal">{$crystal|number}</span></td>
									<td class="res_current poloses_t"><img class="tooltip" data-tooltip-content="<span class='p_res'>{$LNG.tech.903}</span><br/>{$LNG.tip_p_res_h} {$js_deuterium_hr|number}<br/>{$LNG.tip_p_res_d} {($js_deuterium_hr*24)|number}<br/>{$LNG.tip_p_res_m} {($js_deuterium_hr*720)|number}" src="{$dpath}images/deuterium.gif" alt="" title="" /><span id="current_deuterium">{$deuterium|number}</span></td>
									<td class="res_current poloses_t"><img src="{$dpath}images/energie.gif" alt="" title="{$LNG.tech.911}" /><span {if $energy + $energy_used < 0} style="color:red"{/if}>{($energy + $energy_used)|number}&nbsp;/&nbsp;{$energy|number}</span></td>
                                    <td class="res_current" style="border-top:solid 1px #333 !important;"><a href='game.php?page=trader&amp;mode=trade&amp;resource=921'><img src="{$dpath}images/darkmatter.gif" alt="" title="{$LNG.tech.921}" /></a><span class="tooltip_sticky" data-tooltip-content="<a href='game.php?page=trader&amp;mode=obmen'>{$LNG.replenish}</a>" id="current_darkmatter">{$darkmatter|number}</span></td>
								</tr>
								<tr>
									<td class="res_bar tooltip poloses" data-tooltip-content="{$metal_max|number}&nbsp;/&nbsp;{$proc_metal}%"><div><div style="width:{$proc_metal}%; background-color:{$proc_metal_color};" class="res_bar_div"></div></div></td>
									<td class="res_bar tooltip poloses" data-tooltip-content="{$crystal_max|number}&nbsp;/&nbsp;{$proc_cri}%"><div><div style="width:{$proc_cri}%; background-color:{$proc_cri_color};" class="res_bar_div"></div></div></td>
									<td class="res_bar tooltip poloses" data-tooltip-content="{$deuterium_max|number}&nbsp;/&nbsp;{$proc_dei}%"><div><div style="width:{$proc_dei}%; background-color:{$proc_dei_color};" class="res_bar_div"></div></div></td>
									<td class="res_bar poloses tooltip" data-tooltip-content="{if ($energy_used + $energy)>0 }{$LNG.free_energy}{else}{$LNG.lack_energy}{/if} {$proc_nrg}%">
                                        <div style="width:48%; float:left; height:10px;">
                                        	<div style=" {if ($energy_used + $energy)<0 }width:{$proc_nrg}%; float:right; background-color:#F00;"{else}width:0px;  float:right;"{/if}class="res_bar_div"></div>
                                        </div>
                                        <div style="width:48%; float:left; height:10px;">
                                        	<div style=" {if ($energy_used + $energy)>0 }width:{$proc_nrg}%; background-color:#0FF;"{else} width:0px;"{/if} class="res_bar_div"></div>
                                        </div>
                                    </td>
                                    <td rowspan="2"  class="res_current"><a href='game.php?page=donation'><img src="{$dpath}images/atm.gif" alt="" title="{$LNG.tech.931}" /></a><span class="tooltip_sticky" data-tooltip-content="<a href='game.php?page=donation'>{$LNG.replenish}</a>" id="current_atm">{$atm|number}</span></td>
								</tr>
								<tr>
                                    <td class="poloses">
                                    {if $darkmatter_cost_trader <= $darkmatter} 
                                       	<a href="game.php?page=trader&amp;mode=trade&amp;resource=901">{$LNG.obmen}</a>
                                    {else}
                                   		<a href="#" class="tooltip_sticky" data-tooltip-content="{$LNG.not_enough_tm}<a href='game.php?page=trader&amp;mode=obmen'>{$LNG.replenish}</a>">{$LNG.obmen}</a>
                                    {/if}   
                                    </td>
                                    <td class="poloses">{if $darkmatter_cost_trader <= $darkmatter} 
                                       	<a href="game.php?page=trader&amp;mode=trade&amp;resource=902">{$LNG.obmen}</a>
                                    {else}
                                   		<a href="#" class="tooltip_sticky" data-tooltip-content="{$LNG.not_enough_tm}<a href='game.php?page=trader&amp;mode=obmen'>{$LNG.replenish}</a>">{$LNG.obmen}</a>
                                    {/if} 
                                    </td>
                                    <td class="poloses">
                                    {if $darkmatter_cost_trader <= $darkmatter} 
                                       	<a href="game.php?page=trader&amp;mode=trade&amp;resource=903">{$LNG.obmen}</a>
                                    {else}
                                   		<a href="#" class="tooltip_sticky" data-tooltip-content="{$LNG.not_enough_tm}<a href='game.php?page=trader&amp;mode=obmen'>{$LNG.replenish}</a>">{$LNG.obmen}</a>
                                    {/if} 
                                    </td>
                                    <td class="poloses">&nbsp;</td>
                                </tr>
								<tr style="display:none;">
									<td class="res_max" id="max_metal">{$metal_max|number}</td>
									<td class="res_max" id="max_crystal">{$crystal_max|number}</td>
									<td class="res_max" id="max_deuterium">{$deuterium_max|number}</td>
								</tr>
								
							</tbody>
						</table>
					</td>
				</tr>
			</tbody>
		</table>
		<script type="text/javascript">
		var resourceTickerMetal = {
			available: {$metal},
			limit: [0, {$js_metal_max}],
			production: {$js_metal_hr},
			valueElem: "current_metal"
		};
		var resourceTickerCrystal = {
			available: {$crystal},
			limit: [0, {$js_crystal_max}],
			production: {$js_crystal_hr},
			valueElem: "current_crystal"
		};
		var resourceTickerDeuterium = {
			available: {$deuterium},
			limit: [0, {$js_deuterium_max}],
			production: {$js_deuterium_hr},
			valueElem: "current_deuterium"
		};
		
		var shortlyNumber	= {$shortlyNumber|json}
		var vacation = {$vmode};
		if (!vacation) {
			resourceTicker(resourceTickerMetal, true);
			resourceTicker(resourceTickerCrystal, true);
			resourceTicker(resourceTickerDeuterium, true);
		}
		</script>
	</div>
	{if $closed}
	<div class="infobox">{$closed}</div>
	{elseif $delete}
	<div class="infobox">{$delete}</div>
	{elseif $vacation}
	<div class="infobox">{$LNG.tn_vacation_mode} {$vacation}</div>
	{/if}
{if $pl_m==1}
    <div id="planet_menu">
	<a href="#full_page" id="message_v">Наверх</a>
    {if $ajax == 1}
    	<div onclick="$.post('./game.php?page=overview&amp;mode=planetall'); $('#pl').load('./game.php?page=overview #table_planet');" class="tooltip" data-tooltip-content="Показать / Скрыть" id="btn_planet_all"></div>
    {else}
   	 	<a href="game.php?page=overview&amp;mode=planetall" class="tooltip" data-tooltip-content="Показать / Скрыть" id="btn_planet_all"></a>
    {/if}
    
     <div id="pl">
        <table id="table_planet">
			<tbody>
            	<tr>
                	<td class="nav_bottom">
                        <a title="{$LNG.lm_forums}" href="game.php?page=board" target="forum">{$LNG.lm_forums}</a>|
                        <a title="{$LNG.lm_topkb}" href="game.php?page=battleHall">{$LNG.lm_topkb}</a>|
                        <a title="{$LNG.lm_records}" href="game.php?page=records">{$LNG.lm_records}</a>|
                        <a title="{$LNG.lm_faq}" href="game.php?page=questions">{$LNG.lm_faq}</a>|
                        <a title="{$LNG.lm_banned}" href="game.php?page=banList">{$LNG.lm_banned}</a>|
                        <a title="{$LNG.lm_rules}" href="index.php?page=rules" target="rules">{$LNG.lm_rules}</a>|
                        <a title="{$LNG.lm_support}" href="game.php?page=ticket">{$LNG.lm_support}</a>|
                        <a title="{$LNG.lm_notes}" href="javascript:OpenPopup('?page=notes', 'notes', 900, 300);">{$LNG.lm_notes}</a>|
                        <a title="{$LNG.lm_buddylist}" href="game.php?page=buddyList">{$LNG.lm_buddylist}</a>|
                        <a title="{$LNG.lm_options}" href="game.php?page=settings">{$LNG.lm_options}</a>
                    </td>
                </tr>
            	<tr>
                	<td width="100%">
                    {if $planet_menu == 1}	
                    	{if $AllPlanets}
                            {foreach $AllPlanets as $PlanetRow}
                            <a href="game.php?page=overview&amp;cp={$PlanetRow.id}" title="{$PlanetRow.name}">
                                <table class="planeta">
                                    <tr>
                                        <td rowspan="2">
                                        	<img width="65" src="{$dpath}planeten/small/s_{$PlanetRow.image}.jpg" alt="{$PlanetRow.name}">
                                        </td>
                                        <td height="13px" class="name">{$PlanetRow.name}</td>
                                    <tr>
                                        <td>{$PlanetRow.build}</td>
                                    </tr>     
                                 </table>
                            </a>
                            {/foreach}
                       
                      	{else}&nbsp;{/if}
                    {/if}
                    </td>
                </tr>
			</tbody>
        </table> 
     </div>
    </div>
{/if}